package com.redoor.app.stake.basicdata.dao;

import com.redoor.app.stake.basicdata.model.BaseStake;
import com.redoor.app.stake.basicdata.model.controllerModel.BaseStakeCriteria;
import com.redoor.app.stake.basicdata.model.serviceModel.BaseStakeServiceBean;
import com.redoornetwork.framework.mybatis.mapper.Mapper;
import com.yotouch.app.stake.model.*;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

@Repository
public interface BaseStakeMapper extends Mapper<BaseStake> {

    /**
     * 分页查询桩集合
     * @param criteria
     * @return
     */
    List<BaseStake> queryStake(BaseStakeCriteria criteria);

    /**
     * 分页查询业务对象
     * @param criteria
     * @return
     */
    List<BaseStakeServiceBean> qryStakeServiceInfoDetail(BaseStakeCriteria criteria);

    /**
     * 修改桩数据
     * @param stake
     * @return
     */
    public int updateBaseStake(BaseStake stake);

    /**
     * 根据主键假删除桩数据
     * @param uuid
     * @return
     */
    public int deleteStake(@Param(value = "uuid") String uuid);

    public String getStakeNoByOrgCode(String orgCode);

    /**
     * 查询桩基本信息
     * @param criteria
     * @return
     */
    public BaseStakeServiceBean getBaseStake(BaseStakeCriteria criteria);

    /**
      * 返回总条数
      * @param criteria
      * @return
      */
    public int queryStakeCount(BaseStakeCriteria criteria);

    public List<Stake> queryStakeHSF(BaseStakeCriteria criteria);

    public int queryStakeCountHSF(BaseStakeCriteria criteria);

    public List<BaseStake> queryStakeByParams(BaseStakeCriteria criteria);
    /**
     * HSF接口(大屏调用)
     * 统计国网/三方桩数据
     * @Author zhangYiHang
     * @Date 2018/3/28 9:28
     * @Param
     */
    GlobalMonitor qryStakeGlobalMonitorToHSF(Map<String, Object> map);
    /**
     * HSF接口(大屏调用)
     * 统计桩数据
     * @Author zhangYiHang
     * @Date 2018/3/28 11:32
     * @Param
     */
    RegionStatistic qryStakeRegionStatisticToHSF(Map<String, Object> map);
    /**
     * 大屏调用统计桩数目
     * @Author zhangYiHang
     * @Date 2018/3/28 18:02
     * @Param
     */
    SocialPile qryBaseStakeCntToHsf(Map<String, Object> map);
    /**
     * HSF接口 调用
     * 社会充电桩排名 （排名前8个)
     * @Author zhangYiHang
     * @Date 2018/3/28 19:31
     * @Param
     */
    List<EChartsData> qryEChartsData(Map<String, Object> map);
    /**\
     * HSF接口 调用
     * 根据传入条件查询桩数量
     * @Author zhangYiHang
     * @Date 2018/3/28 20:05
     * @Param
     */
    int countStakeBySql(@Param("trem") String sql);
    /**
     * HSF 调用
     * 此方法原代码中未被调用,返回结果为stake集合
     * @Author zhangYiHang
     * @Date 2018/3/29 10:25
     * @Param
     */
    List<BaseStake> qryBaseStakeList(Map<String, Object> map);

    /**
     * HSF 统计指标调用
     *
     * @Author zhangYiHang
     * @Date 2018/3/29 19:19
     * @Param
     */
    int selectCountBySelf(Map<String, Object> map);
    /**
     * 查询除当前桩以外同站下的运行桩数目
     * @Author zhangYiHang
     * @Date 2018/4/9 18:57
     * @Param
     */
    int qryStationOnlineStakeNum(@Param("stakeuuid") String stakeuuid);
    /**
     * 桩详情查询
     * @Author zhangYiHang
     * @Date 2018/4/14 20:04
     * @Param
     */
    BaseStakeServiceBean stakeDetail(@Param("uuid") String uuid);
}